package com.ruoyi.hospital.service.storeInfo.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.storeInfo.PharmacyStoreInfoMapper;
import com.ruoyi.hospital.domain.storeInfo.PharmacyStoreInfo;
import com.ruoyi.hospital.service.storeInfo.IPharmacyStoreInfoService;

/**
 * 药店管理Service业务层处理
 *
 * @author wendao
 * @date 2024-08-13
 */
@Service
public class PharmacyStoreInfoServiceImpl implements IPharmacyStoreInfoService
{
    @Autowired
    private PharmacyStoreInfoMapper pharmacyStoreInfoMapper;

    /**
     * 查询药店管理
     *
     * @param id 药店管理主键
     * @return 药店管理
     */
    @Override
    public PharmacyStoreInfo selectPharmacyStoreInfoById(Integer id)
    {
        return pharmacyStoreInfoMapper.selectPharmacyStoreInfoById(id);
    }

    /**
     * 查询药店管理列表
     *
     * @param pharmacyStoreInfo 药店管理
     * @return 药店管理
     */
    @Override
    public List<PharmacyStoreInfo> selectPharmacyStoreInfoList(PharmacyStoreInfo pharmacyStoreInfo)
    {
        return pharmacyStoreInfoMapper.selectPharmacyStoreInfoList(pharmacyStoreInfo);
    }

    /**
     * 新增药店管理
     *
     * @param pharmacyStoreInfo 药店管理
     * @return 结果
     */
    @Override
    public int insertPharmacyStoreInfo(PharmacyStoreInfo pharmacyStoreInfo)
    {
        pharmacyStoreInfo.setCreateTime(DateUtils.getNowTimeSecond());
        return pharmacyStoreInfoMapper.insertPharmacyStoreInfo(pharmacyStoreInfo);
    }

    /**
     * 修改药店管理
     *
     * @param pharmacyStoreInfo 药店管理
     * @return 结果
     */
    @Override
    public int updatePharmacyStoreInfo(PharmacyStoreInfo pharmacyStoreInfo)
    {
        pharmacyStoreInfo.setUpdateTime(DateUtils.getNowTimeSecond());
        return pharmacyStoreInfoMapper.updatePharmacyStoreInfo(pharmacyStoreInfo);
    }

    /**
     * 批量删除药店管理
     *
     * @param ids 需要删除的药店管理主键
     * @return 结果
     */
    @Override
    public int deletePharmacyStoreInfoByIds(Integer[] ids)
    {
        return pharmacyStoreInfoMapper.deletePharmacyStoreInfoByIds(ids);
    }

    /**
     * 删除药店管理信息
     *
     * @param id 药店管理主键
     * @return 结果
     */
    @Override
    public int deletePharmacyStoreInfoById(Integer id)
    {
        return pharmacyStoreInfoMapper.deletePharmacyStoreInfoById(id);
    }
}
